<template>
  <transition :name="$route.meta.transition || 'fade'" mode="out-in">
    <slot></slot>
  </transition>
</template>

<style scoped>
/* 淡入淡出效果 */
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s ease;
}

/* 滑动效果 */
.slide-right-enter-from {
  transform: translateX(30px);
  opacity: 0;
}
.slide-right-leave-to {
  transform: translateX(-30px);
  opacity: 0;
}
.slide-right-enter-active, .slide-right-leave-active {
  transition: all 0.3s ease;
}
</style>